package com.you.learning.jvm.ygc;

/**
 * @Description
 * @Author yough
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2021/1/28
 */
public class YgcDemo1 {
    public static void main(String[] args) {
        /**
         * JVM参数设置，模拟正常的YGC场景
         * -XX:NewSize=5m
         * -XX:MaxNewSize=5m
         * -XX:InitialHeapSize=10m
         * -XX:MaxHeapSize=10m
         * -XX:SurvivorRatio=8
         * -XX:PretenureSizeThreshold=10m
         * -XX:+UseParNewGC
         * -XX:+UseConcMarkSweepGC
         * -XX:+PrintGCDetails
         * -XX:+PrintGCTimeStamps
         * -Xloggc:gc.log
         */
        byte[] array1 = new byte[1024 * 1024];
        array1 = new byte[1024 * 1024];
        array1 = new byte[1024 * 1024];
        array1 = null;
        byte[] array2 = new byte[2 * 1024 * 1024];
    }
}
